<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>动态背景颜色</title>
  <style>
    body {
      height: 100vh;
      margin: 0;
      display: flex;
      justify-content: center;
      align-items: center;
      text-align: center;
      font-size: 24px;
      font-family: Arial, sans-serif;
    }
  </style>
</head>
<body>
  <div>背景颜色会在每秒钟变化！</div>
  <script>
    function getRandomColor() {
      const letters = '0123456789ABCDEF';
      let color = '#';
      for (let i = 0; i < 6; i++) {
        color += letters[Math.floor(Math.random() * 16)];
      }
      return color;
    }

    setInterval(() => {
      document.body.style.backgroundColor = getRandomColor();
    }, 1000);
  </script>
</body>
</html>
